package org.sws.domain.activity.repository;

import org.sws.domain.activity.model.aggregate.CreateQuotaOrderAggregate;
import org.sws.domain.activity.model.aggregate.CreatePartakeOrderAggregate;
import org.sws.domain.activity.model.entity.*;
import org.sws.domain.activity.model.valobj.ActivitySkuStockKeyVO;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @Author sws
 * @Date 2025/3/18 21:13
 * @description: 活动仓储层接口
 */
public interface IActivityRepository {

    ActivitySkuEntity queryActivitySku(Long sku);

    ActivityEntity queryRaffleActivityByActivityId(Long activityId);

    ActivityCountEntity queryRaffleActivityCountByActivityCountId(Long activityCountId);

    void doSaveNoPayOrder(CreateQuotaOrderAggregate createQuotaOrderAggregate);

    void doSaveCreditPayOrder(CreateQuotaOrderAggregate createQuotaOrderAggregate);

    void updateRechargeOrder(DeliveryOrderEntity deliveryOrderEntity);

    boolean subtractSkuStock(Long sku, String key, Date endDateTime);

    void activitySkuStockConsumeSendQueue(ActivitySkuStockKeyVO activitySkuStockKeyVO);

    ActivitySkuStockKeyVO takeQueueValue(Long sku);

    void updateActivitySkuStock(Long sku);

    void clearQueueValue(Long sku);

    void clearActivitySkuStock(Long sku);

    void cacheActivitySkuStockCount(String cacheKey, Integer stockCount);

    UserRaffleOrderEntity queryUnUsedUserRaffleOrder(String userId, Long activityId);

    void saveCreatePartakeOrderAggregate(CreatePartakeOrderAggregate createPartakeOrderAggregate);

    ActivityAccountEntity queryActivityAccountByUserId(String userId, Long activityId);

    ActivityAccountMonthEntity queryactivityMonthAccount(String userId, Long activityId, String month);

    ActivityAccountDayEntity queryactivityDayAccount(String userId, Long activityId, String day);

    List<ActivitySkuEntity> queryActivitySkuByActivityId(Long activityId);

    ActivityEntity queryRaffleActivityByStrategyId(Long strategyId);

    Integer queryRaffleActivityAccountTotalPartakeCount(Long activityId, String userId);

    Integer queryRaffleActivityAccountMonthPartakeCount(Long activityId, String userId);

    Integer queryRaffleActivityAccountDayPartakeCount(Long activityId, String userId);

    int queryActivitySkuSurplus(Long sku);

    ActivityAccountEntity queryAccountSurplus(String userId, Long activityId);

    List<SkuProductEntity> querySkuProductEntityListByActivityId(Long activityId);

    UnpaidActivityOrderEntity queryUnpaidActivityOrder(SkuRechargeEntity skuRechargeEntity);

    BigDecimal queryUserCreditAccountAmount(String userId);

    List<Long> querySkuList();

}
